package de.gwtprime.client.event;

import com.google.gwt.event.shared.GwtEvent;

import de.gwtprime.client.event.handler.UserSettingsChangedEventHandler;
import de.gwtprime.shared.requestFactory.User2Proxy;

/**
 * Fired if user settings were changed (e.g. changed user name in change user name popup)
 * Triggers 
 * @author jan
 *
 */
public class UserSettingsChangedEvent extends GwtEvent<UserSettingsChangedEventHandler>{
	
	public static Type<UserSettingsChangedEventHandler> TYPE = new Type<UserSettingsChangedEventHandler>(); 
	
	private User2Proxy user;
	
	public UserSettingsChangedEvent(User2Proxy user) {
		this.setUser(user);
	}

	@Override
	protected void dispatch(UserSettingsChangedEventHandler handler) {
		handler.onUserSettingsChanged(this);
	}

	@Override
	public Type<UserSettingsChangedEventHandler> getAssociatedType() {
		return TYPE;
	}

	public User2Proxy getUser() {
		return user;
	}

	public void setUser(User2Proxy answer) {
		this.user = answer;
	}


}
